package com.kayt.cyberBar.cyber.business.entity.po;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.*;

import org.codehaus.jackson.annotate.JsonIgnore;

/**
 * The persistent class for the b_cyber_ware_drinks_base database table.
 * 
 */
@Entity
@Table(name="b_cyber_ware_drinks_base")
@NamedQuery(name="BCyberWareDrinksBase.findAll", query="SELECT b FROM BCyberWareDrinksBase b")
public class BCyberWareDrinksBase implements Serializable {
	private static final long serialVersionUID = 1L;
	private Long id;
	private String code;
	private String createTime;
	private String name;
	private String searchKey;
	private String sequence;
	private String statusCode;
	private String typeCode;
	private String cyberCode;
	private String updateTime;
	private String companyItemCode;
	private String shelfLife;
	
	private BCyberBaseUnitMap unitMap;
	
	private List<BCyberWareDrinksDesc> descList = new ArrayList<>();
	private List<BCyberWareDrinksPic> picList = new ArrayList<>();
	private List<BCyberWareDrinksPrice> priceList = new ArrayList<>();
	private List<BCyberWareDrinksRank> rankList = new ArrayList<>();
	private List<BCyberWareDrinksSale> saleList = new ArrayList<>();
	private List<BCyberWareDrinksStock> stockList = new ArrayList<>();
	private List<BCyberWareDrinksTag> tagList = new ArrayList<>();
	private List<BCyberWareDrinksType> typeList = new ArrayList<>();
	private List<BCyberWareDrinksTotal> totalList = new ArrayList<>();

	public BCyberWareDrinksBase() {
	}


	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}


	@Column(name="CREATE_TIME")
	public String getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}


	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Column(name="CYBER_CODE")
	public String getCyberCode() {
		return this.cyberCode;
	}

	public void setCyberCode(String cyberCode) {
		this.cyberCode = cyberCode;
	}


	@Column(name="SEARCH_KEY")
	public String getSearchKey() {
		return this.searchKey;
	}

	public void setSearchKey(String searchKey) {
		this.searchKey = searchKey;
	}


	public String getSequence() {
		return this.sequence;
	}

	public void setSequence(String sequence) {
		this.sequence = sequence;
	}

	@Column(name="SHELF_LIFE")
	public String getShelfLife() {
		return shelfLife;
	}


	public void setShelfLife(String shelfLife) {
		this.shelfLife = shelfLife;
	}


	@Column(name="STATUS_CODE")
	public String getStatusCode() {
		return this.statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}

	@Column(name="TYPE_CODE")
	public String getTypeCode() {
		return this.typeCode;
	}

	public void setTypeCode(String typeCode) {
		this.typeCode = typeCode;
	}


	@Column(name="UPDATE_TIME")
	public String getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}

	@Column(name="COMPANY_ITEM_CODE")
	public String getCompanyItemCode() {
		return companyItemCode;
	}


	public void setCompanyItemCode(String companyItemCode) {
		this.companyItemCode = companyItemCode;
	}


	@OneToMany(targetEntity = BCyberWareDrinksDesc.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	public List<BCyberWareDrinksDesc> getDescList() {
		return descList;
	}


	public void setDescList(List<BCyberWareDrinksDesc> descList) {
		this.descList = descList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksPic.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	public List<BCyberWareDrinksPic> getPicList() {
		return picList;
	}


	public void setPicList(List<BCyberWareDrinksPic> picList) {
		this.picList = picList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksPrice.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	@OrderBy("priceCode desc")
	public List<BCyberWareDrinksPrice> getPriceList() {
		return priceList;
	}


	public void setPriceList(List<BCyberWareDrinksPrice> priceList) {
		this.priceList = priceList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksRank.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	public List<BCyberWareDrinksRank> getRankList() {
		return rankList;
	}


	public void setRankList(List<BCyberWareDrinksRank> rankList) {
		this.rankList = rankList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksSale.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	public List<BCyberWareDrinksSale> getSaleList() {
		return saleList;
	}


	public void setSaleList(List<BCyberWareDrinksSale> saleList) {
		this.saleList = saleList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksStock.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	public List<BCyberWareDrinksStock> getStockList() {
		return stockList;
	}


	public void setStockList(List<BCyberWareDrinksStock> stockList) {
		this.stockList = stockList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksTag.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	public List<BCyberWareDrinksTag> getTagList() {
		return tagList;
	}


	public void setTagList(List<BCyberWareDrinksTag> tagList) {
		this.tagList = tagList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksType.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	public List<BCyberWareDrinksType> getTypeList() {
		return typeList;
	}


	public void setTypeList(List<BCyberWareDrinksType> typeList) {
		this.typeList = typeList;
	}


	@OneToMany(targetEntity = BCyberWareDrinksTotal.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true, mappedBy = "ware")
	@OrderBy("stockCode desc")
	public List<BCyberWareDrinksTotal> getTotalList() {
		return totalList;
	}


	public void setTotalList(List<BCyberWareDrinksTotal> totalList) {
		this.totalList = totalList;
	}
	
	@OneToOne(targetEntity = BCyberBaseUnitMap.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
	@JoinColumn(name="CODE", referencedColumnName="ITEM_CODE", nullable = false, insertable=false, updatable=false)
	@JsonIgnore
	public BCyberBaseUnitMap getUnitMap() {
		return unitMap;
	}


	public void setUnitMap(BCyberBaseUnitMap unitMap) {
		this.unitMap = unitMap;
	}
	
}